import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter_demo/views/login/pretty_login_page.dart';
import 'package:flutter_demo/test/future_demo.dart';
import 'package:flutter_demo/views/app_home.dart';
///app的首页
var homeHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> parms) {
  return PrettyLoginPage();
});

var flutterDemoHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> prams) {
  return FutureDemo();
});

var appHomeHandler = new Handler(
    handlerFunc: (BuildContext context, Map<String, List<String>> prams) {
  return AppHomePage();
});

///对于这个fluro库的具体使用参考
///
/// github:https://github.com/theyakka/fluro
///
/// 或者 https://blog.csdn.net/baidu_32377671/article/details/83788125
class Routers {
  //首页的注册地址一定是'/',其他页面无所谓
  static const String root = '/';

  //future-demo的注册的 地址
  static const String futureDemo = '/future_demo';

  static const String appHome = '/app_home';

  ///路由关系的配置和注册
  static void configureRoutes(Router router) {
    router.define(root, handler: homeHandler);
    router.define(futureDemo, handler: flutterDemoHandler);
    router.define(appHome, handler: appHomeHandler);
  }
}
